package com.yuandm.wxnt;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * @author Administrator
 * @time 2016/1/22 16:19
 * @des ${TODO}
 * @updateAuthor $Author$
 * @updateDate $Date$
 * @updateDes ${TODO}
 */

public class BootReceiver extends BroadcastReceiver {
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)||intent.getAction().equals(Intent.ACTION_MEDIA_MOUNTED)||intent.getAction().equals(Intent.ACTION_MEDIA_UNMOUNTED)) {
            //Log.d("yqb", "检测到开机启动，去启动服务");
            Intent newIntent = new Intent(context, StartService.class);
            context.startService(newIntent);
        }
    }
}
